---
image: /generated/articles-docs-lambda-data-transfer-cost.png
title: Data transfer cost
slug: /lambda/data-transfer-cost
sidebar_label: Data transfer cost
crumb: '@remotion/lambda'
---

When rendering on Remotion Lambda, a headless browser is opened, which opens your [bundle](/docs/terminology/bundle) via the [Serve URL](/docs/terminology/serve-url).  
Your site and assets are being loaded via HTTP, meaning that you will be charged by AWS for the data transfer.

If you have big assets, these charges may add up.  
This site explains two options for reducing the cost if you have big assets.

## Isn't data transfer free if the assets are in the same region?

No, with the default settings, since the transfer happens over HTTP, AWS counts this as egress, even if the assets are in the same S3 region.

## Option 1: Use an alternate CDN for storing assets

Many Remotion users use Cloudflare R2 to store their big assets instead.  
This is easy to achieve - simply put the assets in a Cloudflare R2 bucket and reference them using the HTTP URL that you get.

Cloudflare does not charge for data transfer, so this is a great way to reduce the cost.

Make sure to disable the Bot fight mode for R2:

- Go to Security of your domain -> Settings -> disable "Bot fight mode"
- Ensure you use your own domain on the bucket

This ensures no traffic gets blocked when the Lambda function uses a headless browser to load the assets.

## Option 2: Enable VPC endpoints

You can with some configuration set up a VPC for the Lambda function.

Refer to these [notes](https://github.com/remotion-dev/remotion/issues/3817#issuecomment-3182273841) for how to enable VPC endpoints for Remotion Lambda.

### Caveats

- If a Lambda function already existed, this will not update the settings. Delete the Remotion Lambda function and redeploy a new one.
- You still pay a flat fee per request.
- Setting up a VPC endpoint might restrict other network traffic.
- We do not have recommendations yet for how to configure the VPC endpoint.

## See also

- [Cost example](/docs/lambda/cost-example)
